<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let age = 20;//声明、
        function buy(){
            if(age>18){
                console.log('可以喝啤酒');
            }else{
                console.log('小孩喝可乐');
            }
        }
        buy();
        buy();//调用

        
    </script>
</body>
</html>